<template lang="html">
  <div class="login">
    <LoginTop />
    <LoginMain @sendUserInfo='getUserInfo' :userInfo='userInfo'/>
  </div>
</template>

<script>
import LoginTop from '../../components/Mine/LoginTop'
import LoginMain from '../../components/Mine/LoginMain'
import { mapMutations } from 'vuex'
import { SET_USERINFO } from '../../store/mutation/mutation-types'
export default {
  name:'Login',
  components:{
    LoginTop,
    LoginMain
  },
  data(){
    return{
      userInfo:{
        uname:'12345678901',
        pws:'123'
      }
    }
  },
  methods:{
    ...mapMutations([SET_USERINFO]),
    getUserInfo(data){
      console.log(data);
      this[SET_USERINFO](data)
      this.$router.push('/mine')
    }
  }
}
</script>

<style lang="less" scoped>
.login{

}
</style>
